package com.hochschild.sio.dao.hibernate;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.persistence.EntityManagerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.support.JpaDaoSupport;
import org.springframework.stereotype.Repository;

import com.hochschild.sio.dao.SociedadDao;
import com.hochschild.sio.domain.SociedadSAP;

@Repository
public class SociedadDaoHibernate extends JpaDaoSupport implements SociedadDao {

	@Autowired
	EntityManagerFactory entityManagerFactorySio;
	
	@PostConstruct
	 public void init() {
		  super.setEntityManagerFactory(entityManagerFactorySio);
	}

	public List<SociedadSAP> getSociedades(List<String> idsSociedades) {
		
		String hql = "from SociedadSAP where idSociedadSAP in (:ids)";
		Map<String, List<String>> params = new HashMap<String, List<String>>();
        params.put("ids", idsSociedades);
        params.put("ids", idsSociedades);
		//return this.getJpaTemplate().findByNamedParams(hql, params);
		return null;
	}

	public SociedadSAP getById(String idSociedad) {
		//return this.getJpaTemplate().find(SociedadSAP.class, idSociedad);
		return null;
	}

}
